package com.java83.service.impl;

import com.java83.dao.ManagerDao;
import com.java83.exception.MyException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class Impl2 {
    @Autowired
    ManagerDao managerDao;
    public Map<String, Object> findOne(int id) throws MyException {
        try {
            int i = 1 / 0;
        }catch (Exception e) {
            //抛出自己写的异常
            System.out.println(e+"2");
            throw new MyException("后端有问题！");
        }
        return managerDao.getOne(id);
    }
}
